package a.f.e;

import a.d.n;
import a.d.o;
import a.d.t;
import a.d.w;

final class e
{
  private static final double a = 0.001D;
  
  private static boolean a(o paramo)
  {
    int i = a.B;
    if (i == 0) {
      if (paramo.i() == 0.0D)
      {
        if (i != 0) {
          break label113;
        }
        if (paramo.j() == -1.0D) {
          break label112;
        }
      }
    }
    if (i == 0) {
      if (paramo.i() == 0.0D)
      {
        if (i != 0) {
          break label113;
        }
        if (paramo.j() == 1.0D) {
          break label112;
        }
      }
    }
    if (i == 0) {
      if (paramo.i() == -1.0D)
      {
        if (i != 0) {
          break label113;
        }
        if (paramo.j() == 0.0D) {
          break label112;
        }
      }
    }
    if ((i != 0) || (paramo.i() == 1.0D)) {
      if (i != 0) {}
    }
    label112:
    label113:
    return paramo.j() == 0.0D;
  }
  
  private static t c(o paramo)
  {
    int j = a.B;
    int i = a.A;
    double d1;
    double d2;
    double d3;
    double d4;
    if (j == 0) {
      if (paramo.i() == 0.0D)
      {
        if (j != 0) {
          break label83;
        }
        if (paramo.j() == -1.0D)
        {
          d1 = paramo.d();
          d2 = paramo.e() - paramo.h();
          d3 = paramo.h();
          d4 = paramo.g();
          if ((j == 0) && (i == 0)) {
            break label271;
          }
        }
      }
    }
    label83:
    if (j == 0) {
      if (paramo.i() == 0.0D)
      {
        if (j != 0) {
          break label148;
        }
        if (paramo.j() == 1.0D)
        {
          d1 = paramo.d() - paramo.g();
          d2 = paramo.e();
          d3 = paramo.h();
          d4 = paramo.g();
          if ((j == 0) && (i == 0)) {
            break label271;
          }
        }
      }
    }
    label148:
    if (j == 0) {
      if (paramo.i() == 1.0D)
      {
        if (j != 0) {
          break label210;
        }
        if (paramo.j() == 0.0D)
        {
          d1 = paramo.d();
          d2 = paramo.e();
          d3 = paramo.g();
          d4 = paramo.h();
          if ((j == 0) && (i == 0)) {
            break label271;
          }
        }
      }
    }
    label210:
    if ((j != 0) || ((paramo.i() == -1.0D) && ((j != 0) || (paramo.j() == 0.0D))))
    {
      d1 = paramo.d() - paramo.g();
      d2 = paramo.e() - paramo.h();
      d3 = paramo.g();
      d4 = paramo.h();
      if (i == 0) {}
    }
    else
    {
      return null;
    }
    label271:
    return new t(d1, d2, d4, d3);
  }
  
  static double a(t paramt, o paramo)
  {
    if (a.B == 0) {
      if (a(paramo)) {
        return a(paramt, c(paramo));
      }
    }
    if (o.a(paramo, paramt, 0.001D)) {
      return 0.0D;
    }
    return a(paramt, o.a(paramo));
  }
  
  static double a(t paramt1, t paramt2)
  {
    if (a.B == 0) {
      if (t.a(paramt1, paramt2)) {
        return 0.0D;
      }
    }
    double d1 = a(paramt1, paramt2, false);
    double d2 = a(paramt1, paramt2, true);
    return Math.sqrt(d1 * d1 + d2 * d2);
  }
  
  private static double a(t paramt1, t paramt2, boolean paramBoolean)
  {
    double d1 = paramBoolean ? paramt1.d() : paramt1.e();
    double d2 = paramBoolean ? paramt1.d() + paramt1.b() : paramt1.e() + paramt1.c();
    double d3 = paramBoolean ? paramt2.d() : paramt2.e();
    double d4 = paramBoolean ? paramt2.d() + paramt2.b() : paramt2.e() + paramt2.c();
    return a(d1, d2, d3, d4);
  }
  
  private static double a(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
  {
    int i = a.B;
    if (i == 0)
    {
      if (paramDouble4 < paramDouble1) {
        return paramDouble4 - paramDouble1;
      }
      if (i != 0) {}
    }
    else if (paramDouble2 < paramDouble3)
    {
      return paramDouble3 - paramDouble2;
    }
    return 0.0D;
  }
  
  private static double a(n paramn1, n paramn2)
  {
    if (a.B == 0) {
      if (n.a(paramn1, paramn2) != null) {
        return 0.0D;
      }
    }
    double d = a(paramn1, paramn2.d());
    d = Math.min(d, a(paramn1, paramn2.e()));
    d = Math.min(d, a(paramn2, paramn1.d()));
    d = Math.min(d, a(paramn2, paramn1.e()));
    return d;
  }
  
  private static double a(t paramt, w[] paramArrayOfw)
  {
    int m = a.B;
    int k = a.A;
    w localw1 = paramt.f();
    w localw2 = new w(localw1.a, localw1.b + paramt.c());
    w localw3 = new w(localw2.a + paramt.b(), localw2.b);
    w localw4 = new w(localw3.a, localw1.b);
    n[] arrayOfn = { new n(localw1, localw2), new n(localw4, localw3), new n(localw1, localw4), new n(localw2, localw3) };
    double d = 1.7976931348623157E+308D;
    int i = 0;
    do
    {
      if (i >= paramArrayOfw.length) {
        break;
      }
      n localn = new n(paramArrayOfw[i], paramArrayOfw[((i + 1) % paramArrayOfw.length)]);
      int j = 0;
      if (j < arrayOfn.length)
      {
        d = Math.min(d, a(localn, arrayOfn[j]));
        j++;
      }
      for (;;)
      {
        if (m == 0) {
          if (k == 0)
          {
            if (k == 0) {
              break;
            }
            if (m != 0) {
              continue;
            }
            i++;
          }
        }
      }
    } while (k == 0);
    return d;
  }
  
  static double a(o paramo, w paramw)
  {
    int k = a.B;
    int j = a.A;
    if (k == 0)
    {
      if (a(paramo)) {
        return a(c(paramo), paramw);
      }
      if (k != 0) {}
    }
    else if (o.a(paramo, paramw, 0.001D))
    {
      return 0.0D;
    }
    w[] arrayOfw = o.a(paramo);
    double d = 1.7976931348623157E+308D;
    int i = 0;
    do
    {
      if (i >= arrayOfw.length) {
        break;
      }
      n localn = new n(arrayOfw[i], arrayOfw[((i + 1) % arrayOfw.length)]);
      if (k == 0)
      {
        if (j != 0) {
          break label120;
        }
        d = Math.min(d, a(localn, paramw));
        i++;
      }
    } while (j == 0);
    label120:
    return d;
  }
  
  private static double a(t paramt, w paramw)
  {
    if (a.B == 0) {
      if (paramt.a(paramw)) {
        return 0.0D;
      }
    }
    w localw1 = paramt.f();
    w localw2 = new w(localw1.a, localw1.b + paramt.c());
    w localw3 = new w(localw2.a + paramt.b(), localw2.b);
    w localw4 = new w(localw3.a, localw1.b);
    double d = 1.7976931348623157E+308D;
    n localn1 = new n(localw1, localw2);
    d = Math.min(d, a(localn1, paramw));
    n localn2 = new n(localw4, localw3);
    d = Math.min(d, a(localn2, paramw));
    n localn3 = new n(localw1, localw4);
    d = Math.min(d, a(localn3, paramw));
    n localn4 = new n(localw2, localw3);
    d = Math.min(d, a(localn4, paramw));
    return d;
  }
  
  static double a(n paramn, w paramw)
  {
    int i = a.B;
    double d1 = paramn.d().a;
    double d2 = paramn.e().a;
    double d3 = paramn.d().b;
    double d4 = paramn.e().b;
    double d5 = paramw.a();
    double d6 = paramw.b();
    d2 -= d1;
    d4 -= d3;
    d5 -= d1;
    d6 -= d3;
    double d7 = 0.0D;
    double d8 = d5 * d2 + d6 * d4;
    if (i == 0) {
      if (d8 > 0.0D)
      {
        d5 = d2 - d5;
        d6 = d4 - d6;
        d8 = d5 * d2 + d6 * d4;
        if (i == 0) {
          if (d8 <= 0.0D)
          {
            if (i != 0) {
              break label192;
            }
            d7 = 0.0D;
            if (a.A == 0) {
              break label178;
            }
          }
        }
        d7 = d8 * d8 / (d2 * d2 + d4 * d4);
      }
    }
    label178:
    label192:
    double d9 = d5 * d5 + d6 * d6 - d7;
    if (i == 0) {
      if (d9 < 0.0D) {
        return 0.0D;
      }
    }
    return Math.sqrt(d9);
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.f.e.e
 * JD-Core Version:    0.7.0.1
 */